<div class="fui-page  fui-page-current page-goods-list">
<div class="fui-header">
		<div class="fui-header-left" ng-click="goback()">
			<a class="back"></a>
		</div>
		<div class="title">
			<form method="post">
					<div class="searchbar searchbar-active">
					<div class="search-input">
						<i id="searchsub" class="icon jinyunicon icon-search" ng-click="access(pagedata.op,made_query(pagedata.params))" style="font-size: 1.0rem;"></i>
						<input type="search" id="search" ng-model="pagedata.params.keyword" placeholder="输入关键字..." value="keyword">
					</div>
					</div>
			</form>
		</div>
		<div class="fui-header-right" data-nomenu="true">
			<a href="javascript:;"><i class="icon jinyunicon icon-saoyisao2" id="listblock" style="font-size: 1.0rem;"></i></a>
		</div>
</div>
<div class="fui-content" style="top:1.3rem">
		<div class="weui_cells weui_cells_access">
				<a class="weui_cell" href="javascript:;">
					<div class="weui_cell_bd weui_cell_primary" style="padding:0">
						<span>当前定位/选择地区：{{pagedata.pcd.city}}</span>
					</div>
					<div class="weui_cell_ft" ng-click="pagedata.showdist=1">
						选择县区
					</div>
				</a>
				<div class="row margin0" ng-if="pagedata.showdist==1">
						<div class="jy-3" ng-repeat="item in pagedata.areas[pagedata.pcd.province][pagedata.pcd.city]">
							<div class="yuyue-duan" style="width:auto" ng-click="access_json('/index//pcd_code='+item.code)">
									<div>{{item.title}}</div>
									<div class="clear"></div>
							</div>
						</div>
				</div>
			</div>
			<div class="weui_cells_title">热门地区</div>
			<div class="weui_cells">
				<div class="row margin0">
					<div class="jy-3">
							<div class="yuyue-duan" style="width:auto" ng-click="pagedata.show_district('广东省','深圳市');">
									<div>深圳市</div>
									<div class="clear"></div>
							</div>
						</div>
						<div class="jy-3">
							<div class="yuyue-duan" style="width:auto" ng-click="pagedata.show_district('上海市','上海市');">
									<div>上海市</div>
									<div class="clear"></div>
							</div>
						</div>
						<div class="jy-3">
							<div class="yuyue-duan" style="width:auto" ng-click="pagedata.show_district('广东省','东莞市');">
									<div>东莞市</div>
									<div class="clear"></div>
							</div>
						</div>
						<div class="jy-3">
							<div class="yuyue-duan" style="width:auto" ng-click="pagedata.show_district('北京市','北京市');">
									<div>北京市</div>
									<div class="clear"></div>
							</div>
						</div>
						<div class="jy-3">
							<div class="yuyue-duan" style="width:auto" ng-click="pagedata.show_district('江苏省','南京市');">
									<div>南京市</div>
									<div class="clear"></div>
							</div>
						</div>
						<div class="jy-3">
							<div class="yuyue-duan" style="width:auto" ng-click="pagedata.show_district('浙江省','杭州市');">
									<div>杭州市</div>
									<div class="clear"></div>
							</div>
						</div>
				</div>
			</div>
			<div ng-repeat="(p,item) in pagedata.areas">
				<div class="weui_cells_title">{{p}}</div>
				<div class="weui_cells">
					<div class="row margin0">
						<div class="jy-3" ng-repeat="(k,c) in pagedata.areas[p]">
								<div class="yuyue-duan" style="width:auto" ng-click="pagedata.show_district(p,k);">
										<div>{{k}}</div>
										<div class="clear"></div>
								</div>
						</div>
					</div>
				</div>
		    </div>
</div>
</div>
<div id="show_district" class="modal fade" tabindex="-1" style="z-index:99999;display:none;">
	<div class="modal-dialog" style="width:100%;left:0;bottom:0">
		<div class="modal-bottom">
			<div class="fui-cell-title text-center">地区选择</div>
			<div class="row margin0">
						<div class="jy-3" ng-repeat="item in pagedata.areas[pagedata.pcd.province][pagedata.pcd.city]">
							<div class="yuyue-duan" aria-hidden="true" data-dismiss="modal" style="width:auto" ng-click="access_json('/index//pcd_code='+item.code)">
									<div>{{item.title}}</div>
									<div class="clear"></div>
							</div>
						</div>
			</div>
			<div class="fui-navbar">
				<a aria-hidden="true" data-dismiss="modal" class="nav-item btn btn-success confirmbtn">关闭</a>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
window.scope.location(function(res){
if(!scope.pagedata.pcd.city){
	scope.$apply(function(){
		scope.pagedata.pcd.province = res.addressComponents.province;
		scope.pagedata.pcd.city = res.addressComponents.city?res.addressComponents.city:'深圳市';
	});
}
});
scope.pagedata.show_district=function(p,c){
	scope.pagedata.pcd.province=p;
	scope.pagedata.pcd.city=c;
	$('#show_district').modal();
}
//手机软键盘--搜索
$("body").keydown(function() {
    if (event.keyCode == "13") {
        $('#searchsub').click();
    }
});
</script>